# ---------- ---------- ---------- ---------- ---------- ----------
# drek Makefile
# ---------- ---------- ---------- ---------- ---------- ----------


target: help


.PHONY: help
help:
	@echo "Usage: make [PHONY]"
	@sed -n -e '/sed/! s/\.PHONY: //p' Makefile


.PHONY: clean
clean:
	@py3clean .
	@echo ""


.PHONY: dev
dev: fixed test safer todo
	tree ~/.drek/ -a -L 2


.PHONY: fixed
fixed:
	@black .
	@echo ""


.PHONY: safer
safer:
	@mypy \
             src/drek/__inti__.py \
	     src/drek/business/__init__.py \
	     src/drek/business/archive.py \
	     src/drek/business/stats.py \
	     src/drek/client.py \
	     src/drek/config.py \
	     src/drek/utils/__init__.py \
	     src/drek/utils/environ.py \
	     --disallow-untyped-defs \
             || echo ""
	@echo ""


.PHONY: test
test:
	@python3 -m unittest discover
	@echo ""


.PHONY: todo
todo:
	@echo "TODO:"
	@grep -Iirl 'todo' -A 1 ./ --color=always \
            --exclude=Makefile \
            --exclude-dir=.git \
            --exclude-dir=var \
            || echo "none"
